package com.jackykeke.opengldemo.function

import android.opengl.GLSurfaceView
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.jackykeke.opengldemo.R
import com.jackykeke.opengldemo.renderer.SimpleRenderer

class GraphicsActivity : AppCompatActivity() {


    private var mGLSurfaceView: GLSurfaceView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_graphics)

        setupView()
    }


    private fun setupView() {
        mGLSurfaceView = GLSurfaceView(this)
        setContentView(mGLSurfaceView)
        val renderer = SimpleRenderer()
        //设置版本
        mGLSurfaceView?.apply {
            setEGLContextClientVersion(3)
            setRenderer(renderer)
        }

    }
}